package com.ruiysoft.controller.order.vo;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * OrderPlaceCusVo
 */
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2018-11-10T13:44:11.055+08:00")

public class OrderPlaceCusVo {
  @JsonProperty("sourceType")
  private Integer sourceType = null;
  @Valid
  private List<OrderPlaceSkuCusVo> orderPlaceSkus = null;

  private OrderReceiverInfoVo orderReceiverInfoVo = null;

  public OrderPlaceCusVo sourceType(Integer sourceType) {
    this.sourceType = sourceType;
    return this;
  }

  /**
   * 订单来源 1商品直购 2购物车下单
   * @return sourceType
  **/
  @ApiModelProperty(example = "2", value = "订单来源 1商品直购 2购物车下单")
  public Integer getSourceType() {
    return sourceType;
  }

  public void setSourceType(Integer sourceType) {
    this.sourceType = sourceType;
  }

  public OrderPlaceCusVo orderPlaceSkus(List<OrderPlaceSkuCusVo> orderPlaceSkus) {
    this.orderPlaceSkus = orderPlaceSkus;
    return this;
  }

  public OrderPlaceCusVo addOrderPlaceSkusItem(OrderPlaceSkuCusVo orderPlaceSkusItem) {
    if (this.orderPlaceSkus == null) {
      this.orderPlaceSkus = new ArrayList<OrderPlaceSkuCusVo>();
    }
    this.orderPlaceSkus.add(orderPlaceSkusItem);
    return this;
  }

  /**
   * Get orderPlaceSkus
   * @return orderPlaceSkus
  **/
  @ApiModelProperty(value = "")

  @Valid

  public List<OrderPlaceSkuCusVo> getOrderPlaceSkus() {
    return orderPlaceSkus;
  }

  public void setOrderPlaceSkus(List<OrderPlaceSkuCusVo> orderPlaceSkus) {
    this.orderPlaceSkus = orderPlaceSkus;
  }

  public OrderPlaceCusVo orderReceiverInfoVo(OrderReceiverInfoVo orderReceiverInfoVo) {
    this.orderReceiverInfoVo = orderReceiverInfoVo;
    return this;
  }

  /**
   * Get orderReceiverInfoVo
   * @return orderReceiverInfoVo
  **/
  @ApiModelProperty(value = "")

  @Valid

  public OrderReceiverInfoVo getOrderReceiverInfoVo() {
    return orderReceiverInfoVo;
  }

  public void setOrderReceiverInfoVo(OrderReceiverInfoVo orderReceiverInfoVo) {
    this.orderReceiverInfoVo = orderReceiverInfoVo;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    OrderPlaceCusVo orderPlaceCusVo = (OrderPlaceCusVo) o;
    return Objects.equals(this.sourceType, orderPlaceCusVo.sourceType) &&
        Objects.equals(this.orderPlaceSkus, orderPlaceCusVo.orderPlaceSkus) &&
        Objects.equals(this.orderReceiverInfoVo, orderPlaceCusVo.orderReceiverInfoVo);
  }

  @Override
  public int hashCode() {
    return Objects.hash(sourceType, orderPlaceSkus, orderReceiverInfoVo);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class OrderPlaceCusVo {\n");

    sb.append("    sourceType: ").append(toIndentedString(sourceType)).append("\n");
    sb.append("    orderPlaceSkus: ").append(toIndentedString(orderPlaceSkus)).append("\n");
    sb.append("    orderReceiverInfoVo: ").append(toIndentedString(orderReceiverInfoVo)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

